1. New to Jupyter notebooks?¶
- This is a jupyter notebook file (file extension is .ipynb for python notebook versus .py for standard python scripts)
- It is a format used by many data scientists and researchers for analysis and visualization tasks
- Useful because (a) it is easier to work with and understand than single python script files (.py) and
- (b) enables you to break problems down into steps, and quickly see those results in the same window
- Key point: for data analysis a jupyter notebook is clear and efficient way to conduct analysis and communicate the findings
Two types of Jupyter notebook cells:¶
(1) Markdown cells (Cell->Cell Type->Markdown):
- Descriptions
- text (this entire cell that you are looking at is a Markdown cell where text exists)
- images
- Key point: Markdown cells are a place for notes and descriptions
(2) Code "cells" (Cell->Cell Type->Code) : Actual code
- A code "cell" store and compile your code
- any non-code text must be formatted as a comment - begin with "#"
- Key point: code cells are the workhorse, they execute your program and output results
Running Jupyter notebook cells¶
(1) To run every line of code in the entire notebook
(2) To run only a single code cell
- Click on the cell and hit Shift-Enter